import * as T from '../actionTypes/basic'
import { UserInfo } from '@src/components/schema/basic';
import { Dispatch } from 'redux';
import { MessageSchema } from '@src/components/schema/message';

// 设置基本信息
export const setUserInfo = (data: UserInfo) => ({ type: T.SET_USERINFO, data }) // 设置用户信息
export const setToken = (data: string) => ({ type: T.SET_TOKEN, data }) // 设置token
export const setSendTime = (data: number) => ({ type: T.SET_SEND_TIME, data }) // 设置发送时间
export const setLoginMobile = (data: string) => ({ type: T.SET_LOGIN_MOBILE, data }) // 设置发送短信的手机号
export const updateUncompleteMessage = (dispatch: Dispatch) => ({ type: T.UPDATE_UNCOMPLETE_MESSAGE, dispatch }) // 更新未读消息列表
export const setUncompleteMessage = (data: MessageSchema[]) => ({ type: T.SET_UNCOMPLETE_MESSAGE, data }) // 设置未读消息列表
export const setUncompleteMessageNum = (data: number) => ({ type: T.SET_UNCOMPLETE_MESSAGE_NUM, data }) // 设置未读消息数量


